<?php
namespace app\index\controller;
use app\admin\model\ProfessClassify;
use app\admin\model\ProfessLunbo;
use app\admin\model\ProfessAdvert;
use app\admin\model\ProfessForum;
use app\admin\model\ProfessForumReply;
use app\admin\model\MemberUser;
use app\admin\model\ProfessForumClick;
use app\admin\model\ProfessForumReplyClick;
use think\Controller;

class Publictem extends Controller
{
    //图片上传
    public function upload($file){
        $info = $file->move( '../public/uploads');
        if ($info) {
            $result = [
                'code'     => 1,
                'msg'      => '上传成功',
                'url' => '/uploads/' . str_replace('\\', '/', $info->getSaveName())
            ];
        } else {
            $result = [
                'code' => 0,
                'msg'  => $file->getError()
            ];
        }
        return $result;
    }
    public function shopImage(){
        $file =request()->file('file');
        $ret = $this->upload($file);
        return json($ret);
    }





}
